import http from './interface'

// import { http} from './service.js'



// 商品列表
// /aliMini/system/cardGoods/queryCardGoodsList
export const getList = (data) => {
	return http.request({
		url: 'aliMini/system/cardGoods/queryCardGoodsList',
		method: 'GET'
	})
}
// /aliMini/system/cardGoods/queryCardGoodsInfo?id=1
export const getInfo = (id) => {
	return http.request({
		url: 'aliMini/system/cardGoods/queryCardGoodsInfo?id=' + id,
		method: 'GET'
	})
}
// /pay/aliMiniPay/pay
export const payOrder = (data) => {
	return http.request({
		url: 'aliMiniPay/appPay/cardGoodsPay',
		method: 'POST',
		data: data
	})
}
// /aliMini/auth/ali/login
export const login = (data) => {
	return http.request({
		// url: 'app/auth/ali/login',
		url:'app/auth/wechat/login',
		method: 'POST',
		data: data
	})
}
// /resource/sms/aliMiniLoginCode?phonenumber=
export const aliMiniLoginCode = (phonenumber) => {
	return http.request({
		url: 'app/resource/sms/aliMiniLoginCode?phonenumber=' + phonenumber,
		method: 'get',
	})
}
// /aliMini/system/user/queryMyUserInfo?deviceType=PC&deviceId=
export const getUserInfo = (phonenumber) => {
	return http.request({
		url: 'app/system/user/queryMyUserInfo',
		method: 'get',
	})
}
// /aliMini/system/cardGoods/queryCardGoodsOrderList?pageSize=1&pageNum=1&orderStatus=
export const getOrderList = (pageSize, pageNum, orderStatus) => {
	return http.request({
		url: `aliMini/system/cardGoods/queryCardGoodsOrderList?pageSize=${pageSize}&pageNum=${pageNum}&orderStatus=${orderStatus}`,
		method: 'get',
	})
}
// /aliMini/system/cardGoods/queryCardGoodsOrderInfo?id=1
export const getOrderInfo = (id) => {
	return http.request({
		url: `aliMini/system/cardGoods/queryCardGoodsOrderInfo?id=${id}`,
		method: 'get',
	})
}